import { request, config } from 'utils'

const { api } = config
const { customerList, customerListAll, customerAdd, customerGetNumber,customerEdit, customerQuery, customerDel, customerMultiDel, filesUpload, customerGetImg, customerMerge } = api

export async function list (params) {
  return request({
    url: customerList,
    method: 'post',
    data: params,
  })
}

export async function listall (params) {
  return request({
    url: customerListAll,
    method: 'post',
    data: params,
  })
}

export async function query (params) {
  return request({
    url: customerQuery,
    method: 'put',
    data: params,
  })
}


export async function create (params) {
  return request({
    url: customerAdd,
    method: 'post',
    data: params,
  })
}

export async function update (params) {
  return request({
    url: customerEdit,
    method: 'put',
    data: params,
  })
}
export async function remove (params) {
  return request({
    url: customerDel,
    method: 'delete',
    data: params,
  })
}

export async function patchremove (params) {
  return request({
    url: customerMultiDel,
    method: 'delete',
    data: params,
  })
}

export async function uploadfile (params) {
  return request({
    url: filesUpload,
    method: 'post',
    data: params,
  })
}

export async function getImg (params) {
  return request({
    url: customerGetImg,
    method: 'get',
    data: params,
  })
}

export async function getNumber (params) {
  return request({
    url: customerGetNumber,
    method: 'put',
    data: params,
  })
}

export async function Merge (params) {
  return request({
    url: customerMerge,
    method: 'post',
    data: params,
  })
}
